﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using NBlock.MVCControl;
using System.Linq.Expressions;
using Cost.Models;

namespace Cost.Controllers
{
    public class MaterialProcessViewController : Controller
    {
        #region 构造函数
        private readonly ICostRepository<MaterialProcessItem> materialprocessRepository;

        public MaterialProcessViewController(ICostRepository<MaterialProcessItem> materialprocessRepository)
        {
            this.materialprocessRepository = materialprocessRepository;
        }
        #endregion
        //
        // GET: /MaterialProcessView/

        public ActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public JsonResult List( nbPageInfo pager, nbSearchCondition where)
        {
            var pageData = materialprocessRepository.GetPageable(pager, where);
            var data = pager.ToGridData(pageData);
            return Json(data);
        }
    }
}